﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Reflection;
using System.IO;
using MsTestUtilities.SolutionAnalysis;

namespace MsTestUtilitiesTests.SolutionAnalysisTests.CsProjectTests
{
    [TestClass]
    public abstract class ProjectParsingFixture
    {
        [TestInitialize]
        public void ProjectParsingFixtureSetup()
        {            
            using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(GetType(), "TestProjects." + ProjectFile))
            using (var reader = new StreamReader(stream))
            {
                var content = reader.ReadToEnd();
                Project = CsProject.LoadFromXml(content);
            }
        }

        protected CsProject Project { get; private set; }

        protected abstract string ProjectFile { get; }
    }
}
